//
//  Constant.swift
//  Weibo24
//
//  Created by apple on 16/2/26.
//  Copyright © 2016年 apple. All rights reserved.
//

import Foundation
import UIKit

//MARK:--微博系统申请的账号信息

let App_URL = "http://www.itcast.cn"
let App_KEY = "1016883931"
let APP_SECERT = "ac08b0b8892b90753bf4be3f8dc1af4e"


let kNotificaionChangeRootVC = "ChangeRootVC"
let kNotificationEmoticonTransform = "CZEmoticonTransoform"

//MARK:--系统宽高度
let kUIScreenBounds = UIScreen.mainScreen().bounds
let kUIScreenWidth = UIScreen.mainScreen().bounds.width
let kUIScreenHeight = UIScreen.mainScreen().bounds.height

//MARK:--颜色相关

//let randomColor = UIColor(red: CGFloat(random()%255)/255.0, green: CGFloat(random()%255)/255.0, blue: CGFloat(random()%255)/255.0, alpha: 1)
func randomColor() -> UIColor{
    return  UIColor(red: CGFloat(random()%255)/255.0, green: CGFloat(random()%255)/255.0, blue: CGFloat(random()%255)/255.0, alpha: 1)
}

//MARK:--打印相关
/// 输出日志

/// - parameter message:  日志消息

/// - parameter logError: 错误标记，默认是 false，如果是 true，发布时仍然会输出

/// - parameter file:     文件名

/// - parameter method:   方法名

/// - parameter line:     代码行数

func printLog<T>(message: T,
    logError: Bool = false,
    file: String = __FILE__,
    method: String = __FUNCTION__,
    line: Int = __LINE__)
{
    if logError {
        print("\((file as NSString).lastPathComponent)[\(line)], \(method): \(message)")
    } else {
        #if DEBUG
            print("\((file as NSString).lastPathComponent)[\(line)], \(method): \(message)")
        #endif
    }
}
